<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title> 数据双向绑定 v-model</title>
  <script src="./vue-2.4.0.js"></script>
</head>
<body>
<div id="app">
  <!--
    v-model双向绑定 绑定的是表单控件
    正常：v-model:value="val"
    简写：v-model="val"
   -->
  <input type="text" v-model="val">
  <button @click="getValue">获取input值</button>
</div>
</body>
<script>
  let vm = new Vue({
    el: '#app',
    data: {
      val: ''
    },
    methods: {
      getValue () {
        console.log(this.val)
      }
    }
  })
</script>
</html>